Fix bug with dependency bigrams (with lemmas and lowercasing enabled)#1
Open
prrao87 wants to merge 3 commits intokristopherkyle:masterfrom
Open
Fix bug with dependency bigrams (with lemmas and lowercasing enabled)#1prrao87 wants to merge 3 commits intokristopherkyle:masterfrom
prrao87 wants to merge 3 commits intokristopherkyle:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey Kris,
First of all, thanks so much for writing such a nice, easy-to-use tool for corpus analysis! I've been using it in some work I'm doing on studying gendered language in a news corpus, and it's been proving very useful so far. I especially like the dependency bigrams functionality - it's helping me a lot in interpreting linguistic content (far more than say, keyness or n-grams) in my specific corpus.
Bug fix
I did notice that there was a bug when I try to run the dependency bigram function with both lemmas and lowercasing enabled. Instead of lowercasing the text once we obtain the lemma, it was simply returning the lemma regardless of whether or not the
lower=Truekeyword was specified. The fix was simple - it's just an additional indented if-block as can be seen in the commit diff.For example, I expect that when
lower=Trueandlemma=Trueare both enabled, we should see something like this:However, with the current version, we get this:
Testing
I tested the fix out on multiple cases, and the
lower=Truekeyword argument now works as intended. I just pushed the fix to thedevdirectory for now - let me know if this works or if you want it pushed to the main directory as well.Thanks again for making this - I'm sure it'll be a useful resource for others in the field too. Cheers!